import { pubRequire } from '@utils/public'
const baseUrl = '/partner/prizes'
/*奖品列表*/
export function getPrizeList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
/* 一二级分类 */
export function getClassify(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/classify?parentId=${obj.id}`,
    '',
    callbBack,
    errBack
  )
}
/*奖品详情*/
export function getPrizeDetail(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/detail/${obj.id}`,
    '',
    callbBack,
    errBack
  )
}
/*奖品禁用*/
export function prizeDisable(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/disable/${obj.id}`,
    '',
    callbBack,
    errBack
  )
}
/*奖品启用*/
export function prizeEnable(obj, callbBack, errBack) {
  return pubRequire(
    'patch',
    `${baseUrl}/enable/${obj.id}`,
    '',
    callbBack,
    errBack
  )
}
/* 校验奖品名称 */
export function verifyPrizeName(obj, callbBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${obj.prizeName}`,
    { id: obj.id },
    callbBack,
    errBack
  )
}
/* 新增奖品 */
export function addPrize(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
/* 修改奖品 */
export function editPrize(obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${obj.id}`, obj, callbBack, errBack)
}
